"""This provides conf management settings"""
import os
import sys

def union_settings(first, second):
    """This merges the module of second to the module of the first"""
    me = sys.modules[first]
    settings_dict = dict([(k,getattr(me, k)) for k in dir(me) \
                              if k.upper() == k])

    mod = __import__(second,
                     {},
                     {},[''])

    for setting in dir(mod):
        if setting == setting.upper():
            setattr(me, setting, getattr(mod, setting))

def get_role():
    # If the PENNYPRESS_ROLE var exists, use it
    return os.environ.get("PENNYPRESS_ROLE", None)
        
